import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'login',
      title:'登录',
      component: () => import('@/views/login/index.vue'),
    },
    {
      path:'/',
      name:'layout',
      title:'架子',
      component:()=>import('@/views/layout/index.vue'),
      redirect:'/home',
      children:[
        {
          path:'home',
          name:'home',
          title:'首页',
          component:()=>import('@/views/home/index.vue')
        },
        {
          path:'system',
          name:'system',
          title:'系统概述',
          component:()=>import('@/views/system/index.vue')
        },
        {
          path:'user/profile',
          name:'profile',
          title:'基本资料',
          component:()=>import('@/views/user/profile/index.vue')
        },
        {
          path:'user/avatar',
          name:'avatar',
          title:'更换头像',
          component:()=>import('@/views/user/avatar/index.vue')
        },
        {
          path:'user/password',
          name:'password',
          title:'重置密码',
          component:()=>import('@/views/user/password/index.vue')
        },
        {
          path:'goods/channel',
          name:'channel',
          title:'商品分类',
          component:()=>import('@/views/goods/channel/index.vue')
        },
        {
          path:'goods/manage',
          name:'manage',
          title:'商品列表',
          component:()=>import('@/views/goods/manage/index.vue')
        },
      ]
    }
  ],
})

export default router
